package com.example.shysx11.web;

import com.example.shysx11.service.IGridMemberService;
import com.example.shysx11.vos.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin("*")
@RestController
@RequestMapping("/gridMember")
public class GridMemberWeb {

    @Autowired
    private IGridMemberService service;

    @RequestMapping("/getAll")
    public ResultVo getUsers() {
        return service.getGmMembers();
    }

    @RequestMapping("/getGridMemberByCodeByPass")
    public ResultVo getGridMemberByCodeByPass(String gmCode, String password) {
        return service.getOne(gmCode, password);
    }

    @RequestMapping("/listGridMemberByProvinceId")
    public ResultVo listGridMemberByProvinceId(Integer provinceId) {
        return service.getGmMembersByProvinceId(provinceId);
    }
}